//
//  MyStack.m
//  LabanBrowser
//
//  Created by -Xh- on 3/12/13.
//  Copyright (c) 2013 VNG. All rights reserved.
//

#import "MyStack.h"

@implementation MyStack

-(id)init{
    self=[super init];
    if(self){
        dataList=[[NSMutableArray alloc]init];
    }
    return self;
}

-(void)push:(NSObject *)_object{
    [dataList addObject:_object];
}
-(NSObject *)pop{
    NSObject* popObject = [dataList lastObject];
    if(popObject!=nil){
        [dataList removeObject:popObject];
    }
    return popObject;
}

-(void)toLogWithTag:(NSString *)_tag{
    NSLog(@"------%@------",_tag);
    for(int i=0;i<dataList.count;i++){
        NSLog(@"%i : %@",i,[dataList objectAtIndex:i]);
    }
    NSLog(@" ");
}

-(BOOL)isEmpty{
    return dataList.count==0;
}
@end
